<?php
	class ActionResult{
		var $success = false;
		var $savetype = "";
		var $error = "";
		
		var $actionParameters = array();
		
		function toXml() {
			$result = "<result status=\"";
			if($this->success)
				$result .= "ok";
			else
				$result .= "error";
			
			$result .= "\" saveType=\"".$this->savetype."\">";
			
			if(!$this->success)
				$result .= "<error descr=\"".$this->error."\"/>";
			else {
				foreach($this->actionParameters as $actionParam){
					$result .= $actionParam->toXml();
				}
			}
			
			$result .= "</result>";
			return $result;
		}
		
		function addActionParameter($action){
			array_push($this->actionParameters, $action);
		}
		
	}

?>